It looks like every branch has setImmediate - can we pull that out?