implement memory refreshment logic