restructured load_text to make it suitable for caching
OPTIMIZATION: added caching of texts