refactor codegen facilities for reducedim