Simpler task-handling code