fix SyntaxError in 2.7 raised by "yield from"

rewrite the methods in better way.