moar refactoring