documentation and code cleanup for LegendPlugin module