Renamen encoding/decoding functions