Properly remove cache on unregister, remove unused