Split sanitize and use it in interaction
Support legend sanitize. Fixes #227