some more refactoring of battleships.rb