Removed some useless code and added extract_file()