Resolves #45809: Refactor code and introduce namespacing