Further refactoring of text-controller-impl