rename 'name' parameter to 'type'
add tests for map and collate