refactor map.jinja pattern to DRY