improve encoding config