That's a personal feeling but I think it would be much more readable/easily scannable if all these lines were simply, one after the other, without comments and without the List.flatten.