Make create_mapping easier to test.