expand on encoding API