fix type and constant duplication