More changes to GUI and refactoring