rename package middlewares to middleware and move module middleware