obsolete the old delete function and implement new one

Can now remove based on the type rather than the name, made the old method obsolete, can remove in future release.