Use switch statements to dispatch external functions