deleted some unused methods and extracted TextType enum