* add replace task ability;
* fix problem;
* refactoring.

Change-Id: Ib75312a6eed7fc142c924f1ef47c7c174f5adba0