Optimized _setActive class toggling