Massive Code Cleanup