reorganize preference profile code