added flatMap spring function