More pythonic3 way of decoding