Transitioned middleware to app specific instead of controller