A bit of refactoring for robustness. Direct tag search as options added.