more KernelBP refactoring