refactored utitilities, removed functions no longer in use, except areUnique