optimization fixes
Merge pull request #189 from Jureth/perfomance

Немного оптимизации