Moved sensor refresh to class (doesn't compile)

This version doesn't compile