add globad function syncGet and asyncGet & reduce code