Refactor board logic into smaller methods.