extract func
fix dump restore(missing root) and test for parse end
add tests