Refactored text generation into more logical single class