monitor : change switch to function table