refactor code of draw one line text