cleanup encoder