Move waitBackendReady to TaskSchedulerImpl.start & some code refactor