refactor settings.js