code review

use `map` instead of `flatMap`