Use Task instead of raw thread.