Refactor: Use json-builder instead
Move stuff to sync.js