more refactoring stuff