Major cleaning to MetadataServiceHelper.