Refactor/table rendering