Tidy up sensor addition code