Refactor relations into a trait