Use reflection to pass arguments instead of broken switch.