Refactored all that map-reduce shit.