parsing tags, some design changes