optimize code and add file request module.