Cleaned up UIController code