Refactored mapping method