Code cleanup and removal of old commented out code