Separate queue handling from task execution