Improved function get_text(...)