template and cleanup