remove duplicated code

Looks like when @dmyung  was making some caching changes, he accidentally duplicated some code. I didn't fix all of the issues in that file as some of other duplicated code isn't an exact copy, so I'm not which version is the correct one