Add destructors and resource manager