I don't like conditions in function as parameter. Previously was better, i meant more readable and clear.
No whole code but last line was more clear. Maybe different conception?