Clean up the copied code for the transition state