Remove duplication code