Remove more duplicate code.