Added generic Decode method