Removes unnecessary frames