Many people have the same issue, including me. I dont have advice for you, as i, myself am always trying to get Pheobe to be better about it. Ive come to realise that yorkies ( other small dogs included) are just sometimes stubborn about it and get stuck in their ways and.. as unfortunate as it is, they know THEY run things. haha. They're little spoiled brats, and hold the role well 
 
 
Sticking with a good routine and reward system MAY help. Be persistant and shy away from scolding due to accidents, its only proven(to me) to make things worse.  
Good Luck!