Add replication, refactoring upload