refactored sync functionality to be more readable
Merge pull request #90 from coen-hyde/refactor-sync

Refactored sync functionality to be more readable