Refactor unique method