Refactor datatable template