reduce output file
add special case for map