cleaned up the updateTableOffset method