build main procedures