decoder: improve decoding