Working with_block method without local passing