Minor refactors

As the title suggests.

Some stuff that bugged me a for some time, some stuff CodeCilmate complains about, some other minor stuff I stumbled upon.

Comments, additions, corrections are welcome.