refactored the method to generate announce file.
moved method to write new file from client to util.h
sanitised generate_announce_file() method.