added clearCache
removed dead code