Cleaned up code in UI