Performance and simplicity

Hi,
I have found some other places where code can be improved in readability and also in efficiency.

With best regards
Hynek Vychodil