refractored code to be more modular and truncated text body