minor refactor for encodings