minor refactor of map transformation