Cleaned up for Gui