Improve cache functions
tmp