refactored routing and pairs controller
merge