Refactor to map.