Cleanup of base template