fix return type annotation of q->
move prepared and raw fn annotations to their actual source