optimization with metadata