improvements for getTable, create one if missing and a model or record is given