added nullAttributes to remove unnecessary stuff from map and reduce expressions