Prevented memory leak with previous tasks.
Added task parser factory.