Refactor inserting into tables. Using one tag tbody