Improvement to metadata API