Improve range retrieval and destructure functions.