Fix maintainability issues in qaplug
Fix qaplug issues