Cleaned up cache writer