Outline for refactoring gui.