Refactor getUniqueId into a static method