refactored nested tagname handling (fixes default)