refactoring of code that renders variety lists