flatMap for Maybe and simplify impl