Changed 'collection_source' to 'source' and refactored code to include new 'type'