Implementing cache functionality V1