Simplify Device_XImpl C++ code
Actually, I wanted these changes to be part of !663 (merged), but did not manage it in time. I propose to optimize a bit the code, related to the Device-XImpl in bindings, since now, after Device_6Impl was added it is hideous and unreadable.
Unfortunately, I did sussed fully in optimization, but I think now it is easier to read