Make flat_map part of map