refactored routing to RouterFactory