more crazy refactoring