refactor code in UserDataReader