refactored models to establish correct relationships