use switch instead of function pointers