Made map/reduce/filter implementations uniform.