moved recursive call to renderTag, simplifications