Refine read_from_ram.c