Refactor sync.coffee a bit more