simplified middleware