Better implementation of rule Var