Cache functions code completed