removed presentation code, changed how middleware (more like gates now) work