UI Code Cleanup