solutions/max_kaskevich/2: small refactoring.