Moved factories from closure to object