organizing module middleware