cache and cleanup