Move encode first.