Fix complexity issue in tag sync method