added cache library and refactored main class