eslint fixes, part1
eslint fixes, part2
decreased nesting level
eslint fixes, part3