avoid exponential compilation
make ref fields work with cases