change writefile.h from struct to class