gui refactor