refactoring using wrapper and display using datatables