Refactor
test
t
Fixes legend update