Remove repeated defineProperty code.