Refactoring, much goodness