remove code duplicate