2.x replication refactoring