Re-factored to allowed destroy function.