Refactor the GUI