bmdenc: cleanup

Small improvement. still WIP.