cplex in python + another refactoring