Refactored some stuff

Getting accustomed to the codebase, cleaned some things up.

Having never used a pull request before, I have no idea if this will work! :)