Clean up code
Merge branch 'bugid-10786' into dev