integrate iqd in sj and code clean up