Refactor _updates_cachekey function