added interactive menu, some refactoring