Cleanup: Store middleware in a single place