Refactor: remove some more duplication