moving getMaxCustomVariables to CustomVariables class, a model should not really care about caching etc