Settings cleanup

Settings code deduplicated.
3 files changed