Use Tasks and TaskCompletionSources instead of weird callbacks