refactoring + memory dump