Refactor options.js