update readme file, change some duplicate code