Replaced the caching function with a new one that works using platform and category. Addressed code feedback as well.