Refactor Cache module