More refactoring for KB.