Add finalizeContext methods