More pythonic fix