Refactoring & adding methods for file sync