Cleanup of Template