Simplify firebase sync code.