Reworking the adapter to simplify
Enable CollectionMethods rules in rubocop
(cherry picked from commit a80b69b)