Move branching to before loading