Refactored code that retrieves values from settings