more refactoring fun, going to be beautiful once it's done