major cleanup of get-optiontables