moved general text logic into app js factory