remove redundant copy paste code