Refactoring the settings module