use same approach for impl. custom codec