refactoring: remove duplication in html for the table