Changed findFirstOptional and flatMap implementation a bit