fixbugs
refactor Cache
refactor Cache
test for Cache