Cleaned up factory.