avoid exsess memory usage

- use var_dump instead of print_a
- limit nest
code format