Moved hasOne and hasMany to separate files