normalized version to support other encoders