This seems awkward... Why not throw the exception right away? Why not require it gets passed in as a `Map` to avoid the possibility of duplicates?