Get rid of the frames which aren't needed