refactoring for core-insertion