Refactored the tests of the flow