add common lib for mapreduce
refactor mapreduce, let it more simple