Remove code that creates unnecessary frame objects.