smart pointer for decoder and encoder