implement command Model
fix some relationships in data model