Improve cache dependencies implementation