Improvement to sync algorithm

Jira Issue: WP-1034