satisfy rubocop by shortening line, using exist instead of exists, and collapsing long if check