improved method to query variable content