Add variable references in classes