refactor codes in KeygenSendThread
remove more local files