Make the code more readable/pythonic.