Made router handler factory, changed router handler to other places