general cleanup that enables the script intended purpose, but this needs much more work (cherry picked from commit 009e1466c8c9a67d97005aff24660ced426e3a35)
general cleanup that enables the script intended purpose, but this needs much more work (cherry picked from commit 009e1466c8c9a67d97005aff24660ced426e3a35)