erase duplicated code