Optimized base loop and tasks.