Refactor: Replace memory aliasing with std::vector
Refactor: Replace memory aliasing with local array
Refactor: Replace memory aliasing with std::vector
Refactor: Input parameters are const