Moar refactoring!