Code cleanup and removal of commented out debugging code