a lot of replication stuff