Refactored _executeFrame() to reduce code duplication.