Refactoring of options.js.