add model factory closes #36