Removes duplicate code.