Refactoring and pep8
add is_broken operation