generalize to connect-layer of middleware