Refactored asynchronous tasks

Refactored asynchronous tasks and created a concrete task
class for each task type. This way it is much easier to get
the results of the task and the code remains cleaner.