cleanup of model template code #113

@bcow @mdietze @serbinsh @dlebauer can you check to make sure this makes sense.