composable middleware utilities