refactor gui