Refactor and add fix to xlxc-destroy