Some implementation of cache. Unable to fix highlighting bug.