Rearranged dployment code a bit.