refactor for settings support.