REF: moving all model parts into compiler