moar refactoriiing