Refactor to allow use of a preloaded model
Use JSON metamodel to avoid loading c.l. from home repo
remove unneeded condition
Update code to new syntax