further classification optimizations for ~30% performance gain