Replaced switch statement for function lookup with a vector.