improve cache mechanism