REFACTOR adjusts coding style and fix typos

Related to @foca comments on main PR :
https://github.com/rails/rails/pull/10891#discussion-diff-5054622

This does not change any functionnal behavior, so there will not be
release for those changes right now.