refactor all the things

i'm looking at you, @martindale