refactor to new config