extracted memories into a module to allow reuse