improve map reduce interface