REFACTOR add ecoding