some more refactorings