Remove unneeded code from several files