Changed api for Factory.build