Refactor test tasks