I don't think this is the right place for this code; user_api should be completely agnostic of what preferences are contained in it.