restructure core file