Margot writes cache functions