The alternatives to copying this small bit of code are even worse. This is unmodified, except for the added line 3.