refactoring xortag base and added tests file