Improve tags logic.