refactor use of options