Having to write something once, just write it.
Having to write something twice with small differences, think about it.
Having to write something three times? Consider refactoring.