* adjust cache logic for easy to extend.