Leeds, 15th in the Championship table, looked vulnerable at the start of the season, particularly at set-pieces.
But central defender Bartley has formed an impressive partnership with Pontus Jansson in recent weeks.
Bartley, on loan from Swansea, told BBC Radio Leeds: "You'd have to give the credit to Pep. He had a look and then changed our set-up slightly."
The Yorkshire side were beaten in their opening two league matches of the season, losing 3-0 at QPR and then 2-1 at home to Birmingham.
But on-loan Torino defender Jansson, 25, has played a key role in their improvement.
Leeds have kept clean sheets in their last two games and conceded just two goals in their last four matches - and just one in their last four away games.
Bartley, also 25, explained: "We have Pontus as a spare man who isn't picking up anyone and whose job it is to go and attack the ball, which he has done very well.
"It's made us look a lot more solid. We're going out there now thinking we're going to win, not just hoping."
Kyle Bartley believes assistant boss Pep Clotet deserves credit for Leeds United's improved defending.