optimizing active classing