Major code refactoring improvements.
Add refactoring of XML tags.