Moved code out to be part of general function for getting covers. Added possibility for having covers defined by the provider.