Used Reflection for instantiating a codec