refactor: map.flatten! => flat_map