remove middleware stuff