  We test an improved finite-size scaling method for reliably extracting the
critical temperature $T_{\rm BKT}$ of a Berezinskii-Kosterlitz-Thouless (BKT)
transition. Using known single-parameter logarithmic corrections to the spin
stiffness $\rho_s$ at $T_{\rm BKT}$ in combination with the Kosterlitz-Nelson
relation between the transition temperature and the stiffness, $\rho_s(T_{\rm
BKT})=2T_{\rm BKT}/\pi$, we define a size dependent transition temperature
$T_{\rm BKT}(L_1,L_2)$ based on a pair of system sizes $L_1,L_2$, e.g.,
$L_2=2L_1$. We use Monte Carlo data for the standard two-dimensional classical
XY model to demonstrate that this quantity is well behaved and can be reliably
extrapolated to the thermodynamic limit using the next expected logarithmic
correction beyond the ones included in defining $T_{\rm BKT}(L_1,L_2)$. For the
Monte Carlo calculations we use GPU (graphical processing unit) computing to
obtain high-precision data for $L$ up to 512. We find that the sub-leading
logarithmic corrections have significant effects on the extrapolation. Our
result $T_{\rm BKT}=0.8935(1)$ is several error bars above the previously best
estimates of the transition temperature; $T_{\rm BKT} \approx 0.8929$. If only
the leading log-correction is used, the result is, however, consistent with the
lower value, suggesting that previous works have underestimated $T_{\rm BKT}$
because of neglect of sub-leading logarithms. Our method is easy to implement
in practice and should be applicable to generic BKT transitions.
