refactor: add memory.c