extracted plug middleware into separate repo