Remove duplication in functions for filling text.