Refactored iq.c to register iq handlers