made encoding configurable.