improving None encoding/decoding