finish refactor sync module for more robust synchronizations