more refactoring -.-