Refactor TaskRouter and fix creation & deletion