Remove unnecessary separation of map into map and match. Simply throw the block containing the case statements directly into the map because that will take a single argument and produce results, which is what is required of a function thrown into map