MemoryDialog refactoring