sensor setup code cleanup.