moving encoding in place