cleaned up some io stuff, more routing