more refactoring!