change file write interface and parsed tree structure