optimized writeMap of writer