refactor GUI