i'd call this `to_json` or something since map has a special meaning in our codebase