prepare dump command & some code cleanup
add dump command