feature #2989: Move deleting params and options keys to function