Refactor settings UI