use helper function to reduce duplication in mappings