refactors columns and diags