refactor: improve code by creating a Cache class.

fix: the All target was not correctly handled in the Sensors already written.