Refactoring opencaching implementation