Refactoring. Going functional way. Funcs declarations changed to expressions