clean up template, prepare for provider