Teach notes code to free its internal data structures on request