Add tests for UserSettings
Reduce nesting level