extract decision of used middleware implementation into separate package