Refactor cluster tasks to take cluster parameter