Refactoring to modified ludoJS