refactor creating bundles in kernel