get rid of loops and use new config schema