Refactored states so we can also use them for sensor values