use operator<< to replace dump function