map: use pointers as much as possible to avoid overhead