consolidate to one sync function