vx: encoding refactoring