Tidy up codes and pause after publishing initial state first