build master state