improve flatMap. avoid boxing
add benchmark