refactored to memory config