Changed approach in processing Tag, further details in comments