Remove code duplicate