Now the conversion for the default case works automatically. Additional the code itself were simplified quite a lot and some comments got added.