I realize now that all of these states low to charging could just be initialized in the constructor and saved as properties of the object. That would be more efficient than looking them up again each time something changes.