Refactor settings