Refactor to use yield instead of call(block) in with_format method.