Remove need for class name cache by only computing it once per formula