Move sync out into its own module