Updated Smart Cache cod