cleant up template