Code clean up

I do code quality and review at work, and decided to do some basic static analysis and cleaning, because I had a lazy Sunday. (;