Use TypedQuery for typesafety
Litte formatting and added sensor.core dependency