Move sync into its own module