Major Code Cleanup