merged new code for moving from plugin to kernel core
merged new code for moving from plugin to kernel core