refactor to add configs