fix some pep8 problems
Merge pull request #901 from LipuFei/pep8_and_refactory

Fix some pep8 problems