Use instance_variable_defined? instead of checking for the truth of instance_variable_get