refactored _set to pass it all the options: this also fixes a jshint issue