lots of small refactor on tag / search