janus_finalize_template ==> janus_flatten