cleaning up some code for RTR