Simplifying code to avoid race conditions
Adding a new element to configure HA