refactored sensor to use appropriate fields