[yanwei] refactor and add cache