Factor out functions for inserting text into editor