Move board construction into separate function