refactor transposed table helper