more refactoring