refactor plan router
do some angular lib refactoring to figure out what's left to be done