update code to support other models