Refactoring JS du draft