Refactor reformatage js