Removing of locally cached entries complete

Code is a bit messy, couldn't figure out why the appropriate cleaner
solutions didn't work.