Sort out a load of state settings