code cleanup for somatic calling