Moar refactoring ... omg