Refactor: Replace memory aliasing with std::vector