Refactoring moar!