add codec that accepts functions