refactor captain to dispatcher