added modeldef and context