seperate dump_struct from main