Fix unused imports
Remove unused variables
Add test case for constructor method
Merge branch 'hotfix/#6093-dead-code-cleanups' into develop

Close #6093
Forward Port #6093