Minor cleanups

Made some minor cleanups of the code that shouldn't affect functionality in any way.

Basically just a small step away from hackweek-code into maintainable code :)

Using a PR for visibility purposes, as this might touch stuff you're currently working on.

@kajic @nilsbunger