Refactor settings module.