Refactoring (preparation for real-time sync)