Reorganize file structure and change some hardcode to general codes