middleman implementation