Modernizing Code with xFactor

Introduction

The Fieldtrip Project, an NIH-sponsored website, was created to engage adolescents with educational content by inviting them to watch short films and participate in an online community. Researchers aimed to spur meaningful discussions and encourage adolescents to share their thoughts on education and identity development.

Fieldtrip Films Section Screenshot

A key component of this online environment was the Flash-based video player, which enabled users to watch short films and log their activity. However, as Flash support gradually phased out across modern browsers, the project faced the risk of losing its most critical features—particularly video playback and research logging.

Original Flash-Based Development Environment

The Refactoring Journey

With the gradual obsolescence of Flash, there was the need for a modern approach to preserve video playback and data logging. This strategy involved converting the Flash ActionScript solution into a fully functional HTML5/JavaScript player— capable of maintaining the same interactions while improving security and compatibility.

xFactor with imported code

xFactor is Devis’ airgapped, AI-driven solution for full-stack development, system innovation, and secure refactoring of legacy applications. This platform leverages advanced AI technologies and custom Large Language Models (LLMs) to streamline every stage of development—from initial architecture and design to implementation and deployment—enabling organizations to build scalable, secure, and future-ready systems. By working on airgapped networks and employing advanced security measures, xFactor preserves data integrity and operational continuity even in sensitive environments. Development InfoStructure, LLC (Devis) proudly introduces xFactor as a state-of-the-art platform designed to transform Full-Stack Development and System Creation. It automates code conversion between languages to ensure accurate, context-aware translations and supports secure legacy application lift-and-shift operations, particularly on SIPRNet. Leveraging an airgapped network of LLMs, including custom Precision Language Models (PLMs), xFactor employs genetic algorithms and ensemble techniques to evaluate and refactor extensive codebases with improved precision, enhancing its effectiveness in code assessment and transformation.

xFactor with imported code

Initial refactoring prompt

xFactor was used to modernize this Flash code. After importing the code, an instruction to transform the Flash code into an HTML5-based video player. This prompt established that the resulting player must maintain the same functionality—especially its logging capability—and simply replace the video source with a modern URL.

“Refactor the provided Flash code into an HTML5 video player page using JavaScript and CSS. Ensure the refactored code maintains the same functionality and behavior as the original Flash code, including the logging functionality which should be displayed below the video player. Replace the existing video source with the video from the URL - https://genitive.ai/wp-content/uploads/2025/01/xFactor-Refactoring.mp4

Initial Code Generation

xFactor’s initial code generation produced a straightforward HTML5 structure for the video player, providing the essential skeleton for playback, controls, and logging. Below is the first draft of the refactored code that replaced the Flash interface.

Refactored & Commented Code

Next, xFactor applied its enhance code feature to thoroughly comment the initial code, clarifying each step’s purpose and ensuring maintainability. Below is the fully Refactored & Commented Code that preserves logging functionality and introduces basic controls in a more robust, modern structure.