Use map-indexed instead of a home-grown construct