clean code and introduce local variables to represent the TextEdits