splitting model into graph and labeling