Made sensor class more generic