removes duplicates from category body
refactors functions