few more refactorings.