refactored to_board method