refactoring, redesign and autostart added