delete unneeded modules and ties