Added cache optimization