refactoring hard...