remove deplicate code