refactoring of codecs