Refactor custom tasks