real time sync
refactoring