Refactor mapping writers