added some template factories to help to encode instructions by using opcode and operands matching