Cleaned up some gui code