refactored some stuff trying to read sensors, etc