state server upgrade sync refactoring

Various clean ups for the recent state server upgrade synchronisation work.