more pep8 and removed has_key refference