Refactor `remove-duplicate-dependencies` and fix #13