Cleaned up GUI code