The first time you implement something, just do it.
The second time you implement the same thing, copy it.
The third time, refactor.
The OP seems like an interesting variation on the same theme.[0] http://en.wikipedia.org/wiki/Rule_of_three_(computer_program...