refactoring for options.