Rubocop: move some things around, plus corrections