Insight tidyup (rebased onto develop)



This is the same as gh-1369 but rebased onto develop.

----

Minor code cleanup for Insight.