KB optimization