Optimized base loop class.