implementation is using yield instead of instance_eval