minor refactoring to the gui