Add a AbstractMetadataRepository to remove duplicated code
merge branch from Carlos. Thanks mate!!