Save the state of the datatables, some cleanups