Refactored for settings
Refactored for settings