Added easy switch between async and sync