refactor thor task