Remove code duplicated