global options & refactoring