Refact. caching, impl. ranges