making mapper functions dry