Refactors and keeps autodelete