refactor dump