moved all text storage implementation into its own class