refactor config resource