Add getTextField method and refactor comments