Simple encoding of objects