switching define to yield instead of instance_eval