move model specification functions into a separate module