removed unnecessary writeStringToFile method