Cleanup of factory variables