improvements following code review with MT, tidying up, and a new test for uniqueness
made the preference model repository scoped, tidied it up and fixed the tests