Remove merge code from encoder