Refactoring Datatables patterns