simplified fromHex, fromDecimal
simplified switch case parsing even further