Code Cleanup & Debugging