sync refactoring
Merge pull request #57 from matiu/feature/04sync

awesome!