Refactored synchronization logic to dedicated service for better readability