Refactor settings validation