Improve code representation of get_kappa