Improves legend styles. Removes unused templates