restruct the whole core file.