refactoring numvar and numconstr