Refactor for config