Refined preferences code