shorten code which writes feeds to file