Mapper function optimizations