some alterations, thx rubocop