dynamic allocation of toHardware type, now relies on encode and decode functions within hardwareTranslator