Extract a TextBodyBuilder class

refactoring and added tests.