Split out branch_copy_flags method to placate code complexity check