python refactorings II