create models and relationships