Fix duplication code