refactored board.rb, decompose long method