Refactor hide-show items according to items type