Revert "ApexQ: remove factory debugging"

This reverts commit 061e7dcadad73256edc3e61de21fdae514a08276.