Refactor to avoid an unnecessary Maybe in the pipe