General code clean up and codestyle updates