Moved updateCaretPos method responsibility to owner class.