cleanup and metadata support