extract text generate logic to separate method