More correct fix based on collection mapping information
Refactoring of contributed code
Add more tests for NH-3408