Refactor

Quick little tidy up so that I can tinker with it easier. I've tried to explain my reasoning in the commit message.