Refactored the check site sync code