added utility function to ModelCode class