Remove code duplicity