I would definitely use a map to simplify the inner...
# codereview
d
I would definitely use a map to simplify the inner when.