moved some methods into ModelUtil