Mapping functions refactored