test(routing): testing clearing of template and related refactoring