code refactoring of Battleships class and Rules module