refactored rtr & client