Cleaned up UI display code.