major refactoring, temporarily removed dialog window