Test suite clean up with the use of the task factory.
Some refactoring to avoid code duplication.