improve map reduce and doc