Minor refactor to Memory class