moving code from KC proper