decouple caching and allow to define another cache model, fix #2 #3