refactor/documentation of exactlytwo encoding