WIP refacto editor js