Refactor text edit view