[query-register] little refactoring to detect registration of queries