restructured classlist usage to reduce runtime performance