`map` ... `flatten` can just be `flatMap`.