move codec code to `pre_app_init()` to address pull request notes