Some typo fixes, some style fixes (RuboCop) and also some refractor (Rubocop)