ongoing refactoring. Moved several controls to model and AppManager is finally gone.