restructure core files