Use a local variable for route and set based on type

Signed-off-by: Greg Zapp <greg.zapp@gmail.com>