build global model