Refactored some of Syncer.sync method for easier readability

Hi

I refactored some code to make the code more readable. It does not change any feautres(as this is in feature freeze software). Remark this is my first contribution to a Open Source project(beside my own), so if I did something wrong with this pull request please tell me.

Regards
Martin