Clean-up: minor code rearrangements for readability and less code duplication.
Clean-up: minor code rearrangements for readability and less code duplication.

Alexpux/Coin3D,Alexpux/Coin3D,Alexpux/Coin3D,Alexpux/Coin3D