Improved use of generics in MetadataDeployService