More refactoring. Expansion of GUI.