uidemo refactor : move the preferenceutils to applib and update model