Split transposition table lookup in a separate function