Refactored for settings