Remove some redundancy for handling flow merging