refactoring options and input.