Refactor table with Val's idea about hash of tr and json