move text editor functions to service