Using the map() and reduce() functions to sanitize raw data