better named regex variables, fixed possible bug in routing, misc cleanup