Destroy logic got from jfschwarz's fork