Made cleanup do: end() destroy() and unref()