refactoring of the gui and ioc added