implementation of xtags support, polishing