Use Task instead of Thread.