Cleanup

Code cleanup and comments