begin routing logic