Make code more testable
Fix bad mapping
Add detail tests
Update testing data