Code cleanup and final commit