Refactor type array to set