added new sync method and refactor