make code more "pythonic"