cleanup device_type method

thx @matsumonkie