refactoring and fixes
improved options