fixed some pep8's errors and add refactory actions