refactoring of encoding design in progress