Restructuring the qip module