improve decoding process