Function pointers instead of huge switch case