Opinionated code cleanup

I was starting to work on extending this, and decided to take 5 min and clean up the code a little bit, to make it easier for me to work with.