Refactor script; add full dump