Refactoring and cleaning up ServerSyncEngine.