Reified: fixed flattening + optimized expr generation