refactoring madness