Added is_console and more rules to detect device class