moved router module to middleware