erase duplicated code AFAP