Changed from providing a Type for every decode call to use a generic class.