routing refactored to router