At a first glance: statements like this are going in the wrong direction. Double indirection and function pointers are really ugly to debug.