yield simplify code