Create middleware component