refactoring and implementation of dump methods