Tweak middleware