General Cleanup

I tried to do some cleanup and thought you might be interested in them? I hope I have followed the right procedure to contribute some code?