Updated model system to handle relations